<extend name="Index::index"/>
<block name="title"><title>分类管理</title></block>
<block name="table">
<div class="agoods_nav">
		<span>分类列表</span>
		<a href="{:U('index',['id'=>$ppid])}"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">返回上级</button></a>
		<a href="{:U('Cate/add')}"><button style="width:100px;height:40px;border:none;background:#6CCCCB;float:right;margin-right:40px;margin-top:5px;border-radius:10px;color:#2C6787;">添加一级分类</button></a>
	</div>	
	<table class="table" border="1" cellspacing="0" cellpadding="5" align="center">
		<tr bgcolor="#ccc">
			<th>编号</th>
			<th>类名</th>
			<th>PID</th>
			<th>层级</th>
			<th>状态</th>
			<th>操作</th>
		</tr>
		<notempty name="list">
			<foreach name="list" item="val">
				<tr>
					<td>{$val['id']}</td>
					<td>{$val['name']}</td>
					<td>{$val['pid']}</td>
					<td>{$val['path']}级分类</td>
					<td width="100px;">
					<if condition="$val['status'] eq 1">
					<a href="{:U('Cate/change',['id'=>$val['id'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">YES</button></a>
					<else/>
					<a href="{:U('Cate/change',['id'=>$val['id'],'p'=>$p])}"><button style="width:80px;height:40px;border:none;background:#6CCCCB;border-radius:10px;color:#2C6787;">NO</button></a>
					</if>
				</td>
					<td><a href="{:U('Cate/add',['id'=>$val['id'],'p'=>$p])}" style="color:#000;display:block">添加子分类</a><a href="{:U('Cate/index',['id'=>$val['id'],'ppid'=>$val['ppid']])}" style="color:#000;">查看子类</a>|<a href="{:U('Cate/del',['id'=>$val['id']])}" style="color:#000;">删除</a></td>
				</tr>
			</foreach>
			<else />
				<tr>
					<td colspan="6">没有子类</td>	
				</tr>
			</notempty>
			<tr>
				<th colspan="6">
				 	{$page}
				</th>
			</tr>
		</table>
</block>